import instance from '@/http/index.js'
//注册
export const register = (data) => {
  // 接收输入的数据
  const { account, password } = data
  return instance({
    url: '/api/register',
    method: 'POST',
    data: {
      account,
      password,
    },
  })
}
//登录
export const login = (data) => {
  // 接收输入的数据
  const { account, password } = data
  return instance({
    url: '/api/login',
    method: 'POST',
    data: {
      account,
      password,
    },
  })
}
//忘记密码
export const verify =(data)=>{
  const {account,email} =data
  return instance({
    url: '/user/verifyAccountAndEmail',
    method: 'POST',
    data: {
      account,
      email,
    },
  })
}
//下一步，输入新密码，进行密码重置
export const resetPass = (id, newPassword) => {
  // const { id, newPassword } = data
  return instance({
    url: '/user/changePasswordInLogin',
    method: 'POST',
    data: {
      id,
      newPassword,
    },
  })
}
//去login页面调用接口